package com.njegovanobradovic.pages.admin;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.hibernate.annotations.CommitAfter;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.njegovanobradovic.entities.SocialNetwork;
import com.njegovanobradovic.so.Save;

public class AddNetwork {
	@Inject
	private Save<SocialNetwork> saveNetwork;
	@Property
	private SocialNetwork socialNetwork;
	
	@CommitAfter
	public Object onSuccess(){
		saveNetwork.setObject(socialNetwork);
		saveNetwork.execute();
		return AllNetworks.class;
	}
}
